/*
 * LogisticRegTrainerRunner.cpp
 *
 *  Created on: Dec 23, 2009
 *      Author: tunpixel
 */

#include "../common/Common.h"
#include "LogisticRegStochastic.cpp"
#include "LogisticRegBatch.cpp"

using namespace bouguerra;

void print_usage() {
	printf("Usage: program.exe <regression model> <regression type>\n");
	printf("<regression model>: 0(color differences) , 1 (background differences)\n");
	printf("<regression type>: 0(default, for batch) , 1 ( for stochastic)");
	return;
}

int main(int argc, char** argv) {
	puts("Starting...");

	int regressionType = 0;
	if (argc == 3) {
		regressionType = atoi(argv[2]);
		if (regressionType != 0 && regressionType != 1) {
			print_usage();
			return 0;
		}
	}
	else
	{
		print_usage();
		return -1;
	}

	int regressionModel = atoi(argv[1]);

	if(regressionType == 1)
	{
		LogisticRegStochastic stochastic;
		stochastic.model = regressionModel;
		stochastic.run();
	}
	else
	{
		LogisticRegBatch batch;
		batch.model = regressionModel;
		batch.run();
	}

	return 0;
}

